package com.leonardo.beanme.fields.impl;

import javax.microedition.lcdui.TextField;

import com.leonardo.beanme.fields.abs.TextInput;

public final class FloatInput extends TextInput {

	private static final int FIELD_CONSTRAINT = TextField.DECIMAL;
	
	public FloatInput() {
		super(FIELD_CONSTRAINT);
	}
	
	public Object getValue() {
		String value = ((TextField)super.getField()).getString();
		return invalidValue(value) ? new Float(0) : Float.valueOf(value);   
	}
	
	public Object getDefaultValue() {
		return new Float(0);
	}

}
